package thursday;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Employee[] employees = new Employee[2];

        System.out.println("请输入2个员工的信息:");

        for (int i = 0; i < employees.length; i++) {
            System.out.println("\n第" + (i + 1) + "个员工");
            Employee emp = new Employee();

            System.out.println("请输入姓名: ");
            emp.setName(sc.next());

            System.out.println("请输入性别: ");
            emp.setGender(sc.next());

            System.out.println("请输入年龄: ");
            emp.setAge(sc.nextInt());

            System.out.println("请输入电话: ");
            emp.setPhone(sc.next());

            // 将员工对象存入数组
            employees[i] = emp;
        }

        // 遍历输出员工信息
        System.out.println("\n员工信息列表");
        for (int i = 0; i < employees.length; i++) {
            System.out.println("员工" + (i + 1) + ": " + employees[i].getINFO());
        }

        sc.close();
    }
}










